/* HW-20210915P1 机试题
一行工位坐标，一行消毒器坐标。
*/
#include <algorithm>
#include <climits>
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;

typedef long long ll;

void input(vector<ll> &v){
#if 0
  string s;
  getline(cin, s);
  istringstream iss(s);
  for(ll x; iss >> x;){
    v.push_back(x);
  }
#else
  int n = 1 + rand() % 100;
  for(int i = 0; i < n; ++i){
    v.push_back(rand());
  }
#endif
  sort(v.begin(), v.end());
}

ll method1(const vector<ll> &vw, const vector<ll> &vs){
  ll r = 0;
  for(int w = 0, s = 0, nw = vw.size(), ns = vs.size(); w < nw; ++w){
    while(s < ns && vs[s] < vw[w]){ // 找vs[s]右边最近的消毒器（可能不存在）
      ++s;
    }
    ll d = LONG_MAX;
    if(s < ns){ // 右边有消毒器，vs[s] >= vw[w]
      d = vs[s] - vw[w];
      if(s-1 >= 0){ // 左边有消毒器，且必有vs[s-1] < vw[w]
        d = min(d, vw[w] - vs[s-1]);
      }
    }else{ // 右边没消毒器，s == ns
      d = vw[w] - vs[s-1];
    }
    if(r < d){
      r = d;
    }
  }
  return r;
}

ll method2(const vector<ll> &vw, const vector<ll> &vs){
  ll r = 0;
  for(auto w : vw){
    ll md = LONG_MAX;
    for(auto s : vs){
      ll td = (w >= s ? w-s : s-w);
      if(md > td){
        md = td;
      }
    }
    if(r < md){
      r = md;
    }
  }
  return r;
}

void dump(const vector<ll> &v){
  for(int i = 0, ie = v.size(); i < ie; ++i){
    cout << v[i] << (i < ie-1 ? ' ' : '\n');
  }
}

int main(){
  srand(time(nullptr));
  vector<ll> vw, vs;
  for(ll r1 = 0, r2 = 0, cnt = 1; r1 == r2; ++cnt){
    vw.clear();
    vs.clear();
    input(vw);
    input(vs);
    r1 = method1(vw, vs);
    r2 = method2(vw, vs);
    if(r1 != r2){
      dump(vw);
      dump(vs);
      cout << "r1 = " << r1 << endl;
      cout << "r2 = " << r2 << endl;
    }
    if((cnt % 10000) == 0){
      cout << cnt << endl;
    }
  }
}